#ifndef ___DEBUG_H__
#define ___DEBUG_H__

#include "../Log.h"
#ifdef _DEBUG
#define DEBUG_OUT printf
#else
#define DEBUG_OUT
#endif
#ifdef _DEBUG
void DEBUG_INIT();
void DEBUG_UPDATE();
void DEBUG_RENDER();
void DEBUG_EXIT();
void DEBUG_RESET();

#undef ASSERT
#ifdef WIN32
#define ASSERT(x) {if(!(x)){__asm int 3}}
#else
#define ASSERT(x)
#endif

// #define DEBUG_FIXED(x)          IPLMath_IntToFixed(x)

// Screen debug
//#define DEBUG_MSG(x,y,fmt,...)  IPLMessagePool_AddMessage(DEBUG_FIXED(x),DEBUG_FIXED(240-y),fmt,##__VA_ARGS__)
//#define DEBUG_MSG_COLORED(x,y,r,g,b,a,fmt,...) IPLMessagePool_AddColoredMessage(DEBUG_FIXED(x),DEBUG_FIXED(240-y),r,g,b,a,fmt,##__VA_ARGS__)

// Console
#define CONSOLE_MSG(fmt, ...)    //log(fmt, ##__VA_ARGS__)

#else
#define DEBUG_INIT()
#define DEBUG_UPDATE()
#define DEBUG_RENDER()
#define DEBUG_EXIT()
#define DEBUG_RESET()

#define DEBUG_FIXED(x)
#define DEBUG_MSG(x,y,fmt,...)
#define CONSOLE_MSG(fmt, ...)
#define ASSERT(x)
#endif // _DEBUG

#endif // ___DEBUG_H__
